#include "EPSG/Node.h"

#include "EPSG/Group.h"

EPSG::Node::Node()
{
	_parent = NULL;
}

void EPSG::Node::setupCamera()
{
	
}

void EPSG::Node::setupLights()
{

}

void EPSG::Node::render()
{

}

EPSG::Node* EPSG::Node::setParent( EPSG::Group* parent )
{
	if( _parent == parent )
		return this;

	if( _parent != NULL )
		((EPSG::Group*)_parent)->delChild( this );

	_parent = parent;
	return this;
}

EPSG::Node* EPSG::Node::getParent()
{
	return _parent;
}

void EPSG::Node::setName( std::string name )
{
	_name = name;
}

std::string EPSG::Node::getName()
{
	return _name;
}

std::string EPSG::Node::getType()
{
	return "NODE";
}

void EPSG::Node::print()
{
	if( _name.empty() )
		printf( "unnamed" );
	else 
		printf( "%s", _name.data() );

	if( _parent != NULL )
		printf( " (Parent: %s)", _parent->getName().data() );
	
	 printf( "\n" );
}